package service

import (
	v1 "platform-sastay-file/api/platform/v1"
	"platform-sastay-file/internal/biz"

	"github.com/go-kratos/kratos/v2/log"
	"github.com/google/wire"
)

// ProviderSet is service providers.
var ProviderSet = wire.NewSet(NewPlatformService)

// PlatformService 平台服务
type PlatformService struct {
	v1.UnimplementedPlatformServer
	log *log.Helper
	nu  *biz.NodeUsecase       // 节点逻辑
	dnu *biz.DomainNameUsecase // 域名逻辑
	cu  *biz.ClusterUsecase    // 集群逻辑
}

// NewPlatformService 创建平台服务
func NewPlatformService(logger log.Logger, nu *biz.NodeUsecase, dnu *biz.DomainNameUsecase, cu *biz.ClusterUsecase) *PlatformService {
	return &PlatformService{
		log: log.NewHelper(log.With(logger, "module", "service/platform")),
		nu:  nu,
		dnu: dnu,
		cu:  cu,
	}
}
